const http=require('http')
const request = require('sync-request')
let result=[]
for(let i=1;;i++){
    console.log('请求'+i)
    var sync = request('GET','https://member.bilibili.com/x/web/archives?status=is_pubing%2Cpubed%2Cnot_pubed&pn='+i+'&ps=20&coop=1&interactive=1',{
        headers: {
            "cookie":"b_ut=-1; i-wanna-go-back=-1; _uuid=F2AA3A78-2487-30BD-6BFE-5D306CEFC10F49690infoc; buvid3=B98EDED7-9A69-4DE1-B622-6607520CC644148793infoc; buvid_fp=B98EDED7-9A69-4DE1-B622-6607520CC644148793infoc; blackside_state=1; rpdid=|(u)~J|~JmR)0J'uYJuu)um~m; LIVE_BUVID=AUTO3116327058224376; bp_video_offset_416174750=585481961746242122; fingerprint3=229e2a3348ccbd131839746cdcae0be5; CURRENT_QUALITY=0; CURRENT_BLACKGAP=0; fingerprint=0d1ad2f3faf2f50a1715c6f7d457f20b; buvid_fp_plain=B98EDED7-9A69-4DE1-B622-6607520CC644148793infoc; bp_video_offset_235725986=595823645997483000; bp_t_offset_235725986=595823645997483000; PVID=3; video_page_version=v_old_home; innersign=0; CURRENT_FNVAL=80; SESSDATA=513c0969%2C1653291799%2Ce3f46%2Ab1; bili_jct=9ffa32391e97c5d6a920b86c9679354a; DedeUserID=146668655; DedeUserID__ckMd5=94bd871ed5e0f402; sid=l1ws5cmk; bp_video_offset_146668655=596569050457025400; bp_t_offset_146668655=596569050457025400"
        }
    })
    const arc_audits=JSON.parse(sync.getBody('utf-8')).data.arc_audits
    if(arc_audits){
        result=result.concat(arc_audits)
    }else{
        break
    }
}
http.createServer((req,res)=>{
    res.writeHead(200,{
        'content-type':'application/json;charset=utf-8',
        'Access-Control-Allow-Origin':'*'
    })
    res.write(JSON.stringify(result))
    res.end()
}).listen(8080,()=>{
    console.log('启动成功')
})